package smartcard;

import cardholder.AbstractHolderServer;

public class SmartCard implements AbstractCardClient
{
	private String cardNumber;
	private AbstractHolderServer owner;
	
	public SmartCard(AbstractHolderServer owner, String cardNumber)
	{
		this.owner = owner;
		this.cardNumber = cardNumber;
	}

	public String getCardNumber()
	{
		return cardNumber;
	}

	public void deliverApplication(String program)
	{
		owner.getDeliveryChannel().deliverApplication(this, program);		
	}

	/* (non-Javadoc)
	 * @see smartcard.AbstractClient#notifyOfNewApplication(java.lang.String)
	 */
	@Override
	public void notifyOfNewApplication(String program)
	{
		// notify the owner
		owner.sendEmail("The following application has been delivered to your card: " + program);
	}
}
